﻿<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="shortcut icon" href="<?=base_url() ?>static/images/favicon.png" type="image/png">

  <title>氢元数据-视觉中国</title>

  <link href="<?=base_url() ?>static/css/style.default.css" rel="stylesheet">
    <link rel="stylesheet" href="<?=base_url() ?>static/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="<?=base_url() ?>static/css/jquery.datatables.css">

  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="js/html5shiv.js"></script>
  <script src="js/respond.min.js"></script>
  <![endif]-->
</head>

<body>


<section>

  <div class="leftpanel">

    <div class="logopanel">
        <h1>视觉中国任务</h1>
    </div><!-- logopanel -->

    <div class="leftpanelinner">

        <!-- This is only visible to small devices -->
        <div class="visible-xs hidden-sm hidden-md hidden-lg">
            <div class="media userlogged">
                <img alt="" src="<?=base_url() ?>static/images/photos/loggeduser.png" class="media-object">
                <div class="media-body">
                    <h4>John Doe</h4>
                    <span>"Life is so..."</span>
                </div>
            </div>

            <h5 class="sidebartitle actitle">Account</h5>
            <ul class="nav nav-pills nav-stacked nav-bracket mb30">
              <li><a href="profile.html"><i class="fa fa-user"></i> <span>Profile</span></a></li>
              <li><a href=""><i class="fa fa-cog"></i> <span>Account Settings</span></a></li>
              <li><a href=""><i class="fa fa-question-circle"></i> <span>Help</span></a></li>
              <li><a href="signout.html"><i class="fa fa-sign-out"></i> <span>Sign Out</span></a></li>
            </ul>
        </div>

      <h5 class="sidebartitle">Navigation</h5>
      <ul class="nav nav-pills nav-stacked nav-bracket">
        <li class="<?= !empty($clue) ? "active" :""?>"><a href="<?=site_url('Task_list/index');?>"><i class="glyphicon glyphicon-search"></i> <span>子任务列表</span></a></li>
        <li class="<?= !empty($task) ? "active" :""?>"><a href="<?=site_url('Task_list/task');?>"><i class="glyphicon glyphicon-list-alt"></i> <span>主任务列表</span></a></li>
        <li class="<?= !empty($auto) ? "active" :""?>"><a href="<?=site_url('Task_list/auto');?>"><i class="glyphicon glyphicon-list-alt"></i> <span>自动任务列表</span></a></li>
	      <li class="<?= !empty($msg) ? "active" :""?>"><a href="<?=site_url('Task_list/msg');?>"><i class="glyphicon glyphicon-list-alt"></i> <span>msg信息</span></a></li>
        <li><a href="http://eagle.elephant.vcg.com/compare/spider" target="_blank"><i class="glyphicon glyphicon-th-large"></i> <span>大象Elephant</span></a></li>

      </ul>


    </div><!-- leftpanelinner -->
  </div><!-- leftpanel -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
  <div class="modal-dialog">

    <div class="modal-content" style="overflow: auto" ></div>
      </div>
    </div>
  <div class="mainpanel">

    <div class="headerbar">

      

      <div class="header-right">
        <ul class="headermenu">

          <li>
            <div class="btn-group">
              <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                <img src="<?=base_url() ?>static/images/photos/loggeduser.png" alt="" />
                <?=$username;?>
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                <li><a href="<?=site_url('Task_list/logout');?>"><i class="glyphicon glyphicon-log-out"></i> 退出登陆</a></li>
              </ul>
            </div>
          </li>
        </ul>
      </div><!-- header-right -->

    </div><!-- headerbar -->

    <div class="pageheader">
      <h2><i class="glyphicon glyphicon-search"></i> 搜索引擎 <span>search engine</span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a href="<?=site_url('Task_list/add_dd');?>" class="btn btn-danger" >添加微信任务&nbsp&nbsp10/次</a></h2>
    </div>

    <div class="contentpanel">
        <div class="panel panel-default">
            <div class="panel-body panel-body-nopadding">

                <div class="panel-body">
                  <form class="form-inline" method="POST" action="<?=site_url('Task_list/post_ser/');?>">
                    <div class="form-group">
                      搜索：<label class="sr-only" for="exampleInputEmail2">主任务ID</label>
                      <input type="text" class="form-control" id="exampleInputEmail2" placeholder="主任务ID" name = "task_id" value = "<?= !empty($this->session->data['task_id']) ? $this->session->data['task_id'] :""?>">
                    </div>
                    <div class="form-group">
                      <label class="sr-only" for="exampleInputPassword2">子任务ID</label>
                      <input type="text" class="form-control" id="exampleInputPassword2" placeholder="子任务ID" name="clue_id" value = "<?= !empty($this->session->data['clue_id']) ? $this->session->data['clue_id'] :""?>">
                    </div>
                    类型：<select class="form-control input-sm mb16" name="clue_type" value = "<?= !empty($this->session->data['clue_type']) ? $this->session->data['clue_type'] :""?>">
                      <option value="">全选</option>
                      <option value=1 <?= $this->session->data["clue_type"] == "1" ? 'selected="selected"' : "";?>>网站</option>
                      <option value=5 <?= $this->session->data["clue_type"] == "5" ? 'selected="selected"' : "";?>>app</option>
                      <option value=3 <?= $this->session->data["clue_type"] == "3" ? 'selected="selected"' : "";?>>微博</option>
                      <option value=2 <?= $this->session->data["clue_type"] == "2" ? 'selected="selected"' : "";?>>微信</option>
                      <option>头条号</option>
                    </select>
                    重要：<select class="form-control input-sm mb16" name="is_priority" value = "<?= !empty($this->session->data['is_priority']) ? $this->session->data['is_priority'] :""?>">
                      <option value = "">全部</option>
                      <option value=2 <?= $this->session->data["is_priority"] == "2" ? 'selected="selected"' : "";?>>紧急</option>
                      <option value=1 <?= $this->session->data["is_priority"] == "1" ? 'selected="selected"' : "";?>>不紧急</option>
                    </select>
                    状态：<select class="form-control input-sm mb16" name="status" value = "<?= !empty($this->session->data['status']) ? $this->session->data['status'] :""?>">
                      <option value="">全部</option>
                      <option value=4 <?= $this->session->data["status"] == "4" ? 'selected="selected"' : "";?>>已完成</option>
                      <option value=3 <?= $this->session->data["status"] == "3" ? 'selected="selected"' : "";?>>处理中</option>
                      <option value=2 <?= $this->session->data["status"] == "2" ? 'selected="selected"' : "";?>>未完成</option>
		      <option value=5>抓取异常</option>
                    </select>
                    <button type="submit" class="btn btn-success">搜索</button>
                    <button type="reset" class="btn btn-success">重置</button>
                  </form>
                </div>

            </div><!-- panel-body -->


                </div>

                <div class="table-responsive">
                    <div class="col-md-13">
                    总数量： <?=$count;?>
                    <div class="table-responsive">
                        <table class="table table-success mb30">
                            <thead>

                              <tr>
                                <th width="8%">ID</th>
                                <th width="8%">客户ID</th>
                                <th width="8%">主任务ID</th>
                                <th width="10%">子任务ID</th>
                                <th width="10%">紧急度</th>
                                <th width="10%">状态</th>
                                <th width="10%">分类</th>
                                <th width="36%">操作</th>
                              </tr>
                            </thead>
                            <tbody>
                            <?php foreach ($list as $v): ?>
                              <tr>
                                <th><?=$v['id'];?></th>
                                <th><a data-toggle="modal" data-target="#myModal" href="<?=site_url('Task_list/get_clue/'.$v['id'])?>"><?=$v['company_id']; ?></a></th>
                                <th><a target="_blank" href="http://eagle.elephant.vcg.com/compare/spider?company_id=<?=$v['company_id']; ?>&task_id=<?=$v['task_id']; ?>&clue_id=<?=$v['clue_id']; ?>&url="><?=$v['task_id']; ?></a></th>
                                <th><a target="_blank" href="<?=$v['clue_address']?>"><?=$v['clue_id'];?></a></th>
                                <?php 
                            if($v['is_priority'] ==2){?>
                                <th><b style = "color:red"><?=str_replace([1,2],['普通','紧急'],$v['is_priority']); ?></b></th>
                                <?php
                            }else{?>

                                <th><?=str_replace([1,2],['普通','紧急'],$v['is_priority']); ?></th>
                                <?php
                            }
                            ?>
                                <?php 
                                if($v['status'] == 2){?>

                                <th class="status" style="color: red"><?=str_replace([2,3,4,5],['已审核','处理中','已完成','抓取异常'],$v['status']); ?></th>
                                <? }else{ ?>
                                <th class="status" style="color: green"><?=str_replace([2,3,4,5],['已审核','处理中','已完成','抓取异常'],$v['status']); ?></th>
                                <?php
                                }
                                ?>
                                <th><?=str_replace([1,2,3,4,5,6],['网站','微信','微博','腾讯微博','app','头条号'],$v['clue_type']);?></th>
                                <th>
                                  <a data-clue="<?=$v['id'];?>" onclick="clue(this)">完成</a>
                                  &nbsp;&nbsp;
                                  <a data-clue="<?=$v['id'];?>" onclick="autospider(this)">自动处理</a>
                                  <?php if($v['autospider'] == 1 && $v['zcard'] == 0 && $v['count'] > 0){?>
                                  &nbsp;&nbsp;
                                  <a target="_blank" style="color: red" href="/auto_task?company_id=<?=$v['company_id']?>&task_id=<?=$v['task_id']?>&clue_id=<?=$v['clue_id']?>">预览结果(<?=$v['count']?>)</a>
                                  <?php }elseif($v['autospider'] == 1){?>
                                  &nbsp;&nbsp;
                                  <a target="_blank" style="color: green" href="/auto_task?company_id=<?=$v['company_id']?>&task_id=<?=$v['task_id']?>&clue_id=<?=$v['clue_id']?>">预览结果(<?=$v['count']?>)</a>
                                  <?php }?>
                                </th>
                              </tr>
                              <?php endforeach;?>
                            </tbody>
                        </table>
                    </div><!-- table-responsive -->
                </div>
            </div><!-- contentpanel -->

          </div><!-- mainpanel -->
            <div class="row">
                <div class="col-sm-6">
                    
                </div>
                <div class="col-sm-3 col-sm-offset-3">
                    显示 <input type="text" class="form-control" id="count-num" value="10" style="width:40px;display: inline-block"> 条&nbsp;&nbsp;
                    <button class="btn btn-success"><a href="<?=site_url('Task_list/export_excel');?>">导出excel</a></button>
                </div>
                <div style ="padding-left: 50px;"class = "pagination" ><?php echo $this->pagination->create_links();?></div>
                
            </div>


        </div>
        



</section>
<script type="text/javascript">
function clue(id){
  var ss = $(id).data('clue');
  //alert(ss);
  $.ajax({
    url:"<?=site_url('Task_list/clue_status');?>",
    type:"GET",
    data:{id:ss},
    //dataType:"json",
    async:false,
    success:function(data){
      if(data==111){
        $(id).parent().siblings('.status').text('已完成');
        $(id).parent().siblings('.status').css({ color: "green"});

      }
    }
  });
}

function autospider(id){
  var ss = $(id).data('clue');
  //alert(ss);
  $.ajax({
    url:"<?=site_url('Task_list/autospider');?>",
    type:"GET",
    data:{id:ss},
    //dataType:"json",
    async:false,
    success:function(data){
      if(data==111){
        $(id).parent().siblings('.status').text('处理中');
        $(id).parent().siblings('.status').css({ color: "green"});

      }
    }
  });
}

</script>

<script src="<?=base_url() ?>static/js/jquery-1.11.1.min.js"></script>
<script src="<?=base_url() ?>static/js/jquery-migrate-1.2.1.min.js"></script>
<script src="<?=base_url() ?>static/js/jquery-ui-1.10.3.min.js"></script>
<script src="<?=base_url() ?>static/js/bootstrap.min.js"></script>
<script src="<?=base_url() ?>static/js/modernizr.min.js"></script>
<script src="<?=base_url() ?>static/js/jquery.sparkline.min.js"></script>
<script src="<?=base_url() ?>static/js/toggles.min.js"></script>
<script src="<?=base_url() ?>static/js/retina.min.js"></script>
<script src="<?=base_url() ?>static/js/jquery.cookies.js"></script>

<script src="<?=base_url() ?>static/js/flot/jquery.flot.min.js"></script>
<script src="<?=base_url() ?>static/js/flot/jquery.flot.resize.min.js"></script>
<script src="<?=base_url() ?>static/js/flot/jquery.flot.spline.min.js"></script>
<script src="<?=base_url() ?>static/js/morris.min.js"></script>
<script src="<?=base_url() ?>static/js/raphael-2.1.0.min.js"></script>
<script language="javascript">
    function oCopy(obj){
      //debugger
      $(obj).select();
        document.execCommand("copy",false,null);
    alert("复制成功!");
    }

</script>
<script src="<?=base_url() ?>static/js/custom.js"></script>
<script src="<?=base_url() ?>static/js/dashboard.js"></script>

<script src="<?=base_url() ?>static/js/bootstrap-datetimepicker.min.js"></script>
<script src="<?=base_url() ?>static/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">
    $("#datetimeStart").datetimepicker({
        format: 'yyyy-mm-dd',
        minView:'month',
        language: 'zh-CN',
        autoclose:true
    }).on("click",function(){
        $("#datetimeStart").datetimepicker("setEndDate",$("#datetimeEnd").val())
    });
    $("#datetimeEnd").datetimepicker({
        format: 'yyyy-mm-dd',
        minView:'month',
        language: 'zh-CN',
        autoclose:true
    }).on("click",function(){
        $("#datetimeEnd").datetimepicker("setStartDate",$("#datetimeStart".val()))
    });
    $("#myModal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
    });
    $('.right-keywords li').click(function () {
        $(this).addClass('active');
    });
    $('.right-keywords li').dblclick(function () {
        $(this).removeClass('active');
    });

    $('#custom-media-save').click(function () {
        alert('保存成功');
        location.href=location.href;
    })
</script>
<div style="text-align:center;">
<p>来源：<a href="http://h2design.taobao.com/" target="_blank">氢设计</a></p>
</div>
</body>
</html>
